# 最终答案是 85959030
res = 98765432 - 12345677
for numb in range(12345678, 98765432 + 1):
    length = 8
    numbs = [int(x) for x in str(numb)]
    # test1
    # print(numbs)
    # print(numb)
    # break
    is_include = False
    for i1 in range(length):
        if numbs[i1] == 2:
            for i2 in range(i1, length):
                if numbs[i2] == 0:
                    for i3 in range(i2, length):
                        if numbs[i3] == 2:
                            for i4 in range(i3, length):
                                if numbs[i4] == 3:
                                    is_include = True
                                    res -= 1
                                    break
                        if is_include:
                            break
                if is_include:
                    break
        if is_include:
            break
    if is_include:
        continue
print(res)